Stored Procedures [dbo].[amsp_CMChangeStatus]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@InContentIDnumeric(18,0)9
@InNewWorkflowStatusCodechar1
@InContactIDnumeric(18,0)9
Permissions
TypeActionOwning Principal
GrantExecuteIMIS
SQL Script
-- =============================================
-- This stored procedure changes the status of a content record
--
-- Modifications
-- 07/14/2003   E.Tatsui
-- =============================================

CREATE   PROCEDURE amsp_CMChangeStatus
  @InContentID numeric,
  @InNewWorkflowStatusCode char(1),
  @InContactID numeric
AS

BEGIN

  DECLARE
    @CurrentWorkflowStatus char(1),
    @CurrentContactID numeric

  SELECT @CurrentWorkflowStatus = WorkflowStatusCode,
         @CurrentContactID = ContactID
    FROM Content WITH (NOLOCK)
   WHERE ContentID = @InContentID
  -- Update only if it's changing.
  IF @CurrentWorkflowStatus != @InNewWorkflowStatusCode
     OR IsNull(@CurrentContactID,0) != @InContactID BEGIN
  
    UPDATE Content
       SET WorkflowStatusCode = @InNewWorkflowStatusCode,
           ContactID = @InContactID
     WHERE ContentID = @InContentID
  
    INSERT INTO Content_Workflow_Log (ContentID,
                                      WorkflowStatusCode,
                                      ContactID,
                                      ChangeDateTime)
    VALUES (@InContentID,
            @InNewWorkflowStatusCode,
            @InContactID,
            CURRENT_TIMESTAMP)
  END
END

GO
GRANT EXECUTE ON  [dbo].[amsp_CMChangeStatus] TO [IMIS]
GO
Uses
Used By